home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 49
/
Aminet 49 (2002)(GTI - Schatztruhe)[!][Jun 2002].iso
/
Aminet
/
util
/
wb
/
SmartMenu.lha
/
smartmenu
/
SmartMenuPrefs
< prev
next >
Wrap
Text File
|
2002-03-05
|
10KB
|
590 lines
G4C
WINBIG -1 -1 230 245 SmartMenuPrefs
WinType 01110010
usetopaz
varpath "editmenu/smenupos"
xOnLoad
ifexists assign ~smartmenu
extract #this guipath g4cmenupath
assign smartmenu: $g4cmenupath
endif
ifexists file ~smartmenu:prog-list.db
cli 'echo >smartmenu:prog-list.db "GCDB*N0*N4*N%menu 12 S*N%name 12 S*N%item 16 S*N%prog 256 S"'
endif
if $*smtop = ""
and $*smleft = ""
ifexists window SmartMenu
info gui Smartmenu
*smtop = $$win.top
*smleft = $$win.left
else
*smtop = 600
*smleft = 0
endif
endif
lvuse #this 1
lvchange smartmenu:prog-list.db
update #this 2 $%item
guiload smenupos
guiload editmenu
GuiOpen #This
redraw #this
xonreload
guiwindow #this front
guiwindow #this on
xOnClose
lvuse #this 1
delete t:SmartMenu
guiquit smenupos
guiquit editmenu
GuiQuit #This
xonfail
guiwindow #this resume
xmenu "Projekt" "Laden" "" "L"
guiwindow #this wait
ezreq "Alte Liste laden?" Ja|Nein laden
if $laden = 1
lvuse #this 1
lvchange smartmenu:prog-list.db
lvgo first
update #this 1 0
lvmove 0
endif
guiwindow #this resume
xmenu "Projekt" "Speichern" "" "S"
guiwindow #this wait
ezreq "Liste Speichern?" Ja|Nein spei
if $spei = 1
lvuse #this 1
if $$lv.total != 0
lvuse #this 1
lvsave smartmenu:prog-list.db
lvgo first
update #this 1 0
lvmove 0
else
ezreq "Nix in Liste" "Na toll" ""
endif
endif
guiwindow #this resume
xmenu "Projekt" BARLABEL "" ""
xmenu "Projekt" "Über..." "" "?"
guiwindow #this wait
setvar atxt "SmartMenu & SmartMenuPrefs\n"
appvar atxt "Copyright ©2002 by Nightshade\n\n"
appvar atxt "Diese Programme sind EmailWare!\n\n"
appvar atxt "Meine Email: thenightshade@freenet.de"
ezreq $atxt "Okay" ""
guiwindow #this resume
xmenu "Projekt" BARLABEL "" ""
xmenu "Projekt" Beenden "" "Q"
guiwindow #this wait
ezreq "SmartMenuPrefs wirklich beenden?" Ja|Nein ende
if $ende = 1
guiclose #this
endif
guiwindow #this resume
box -1 -1 0 0 out button
box 10 212 210 2 in ridge
attr resize 0220
XLISTVIEW 20 17 190 148 "" "lv_entry" "" 10 SHOW
attr resize 0022
gadid 1
update #this 2 $%item
text 20 167 170 17 "" 40 box
attr resize 0220
gadid 2
xbutton 194 167 16 17 "P"
attr resize 2200
guiclose smenupos
if $savepos != 1
ifexists window SmartMenu
info gui SmartMenu
top = $$win.top
left = $$win.left
changearg smenupos 0 0 $left
else
top = $*smtop
left = $*smleft
endif
else
top = $*smtop
left = $*smleft
endif
changearg smenupos 0 0 $left
changearg smenupos 0 1 $top
guiopen smenupos
XBUTTON 20 190 32 17 "Neu"
guiopen editmenu new
attr resize 0200
xbutton 55 190 32 17 "Änd"
attr resize 0200
lvuse #this 1
if $$lv.total != 0
guiopen editmenu edit
else
flash
endif
XBUTTON 90 190 32 17 "Lös"
attr resize 0200
guiwindow #this wait
lvuse #this 1
if $$lv.total != 0
extract %item clean delitem
ezreq "$delitem löschen?" "Löschen|Abbruch" del
if $del = 1
lvdel -1
endif
update #this 2 $%item
else
flash
endif
guiwindow #this resume
XBUTTON 155 190 26 17 "/\"
attr resize 2200
gosub #this move up
XBUTTON 184 190 26 17 "\/"
gosub #this move down
attr resize 2200
xroutine move sel
lvuse #this 1
docase $sel
case = up
if $$lv.line > 0
and $$lv.total > 0
new = $$lv.rec
lvgo prev
old = $$lv.rec
lvput $new
lvgo next
lvput $old
lvgo prev
lvmove #$$lv.line
else
flash
endif
break
case = down
if $$lv.total > 0
and $$lv.line < $($$lv.total - 1)
new = $$lv.rec
lvgo next
old = $$lv.rec
lvput $new
lvgo prev
lvput $old
lvgo next
lvmove #$$lv.line
else
flash
endif
break
endcase
XBUTTON -1 220 150 19 "Menü erstellen"
attr resize 2200
lvuse #this 1
if $lv.total = 0
stop
endif
lvsave t:prog-list.db
guiwindow #this wait
.SmartMenu = ""
append env:.SmartMenu 'G4C\n\nWINBIG $*smleft $*smtop 155 11 "SmartMenu"'
append env:.SmartMenu '\nWINTYPE 11010000'
append env:.SmartMenu '\nWINFONT xhelvetica.font 9 000\n\n'
append env:.SmartMenu 'xonload\n\tifexists assign ~smartmenu\n'
append env:.SmartMenu '\t\textract #this guipath g4cmenupath\n'
append env:.SmartMenu '\t\tassign smartmenu: \$\g4cmenupath'
append env:.SmartMenu '\n\tendif\n\tguiopen #this\n'
append env:.SmartMenu '\nxonclose\n\tguiquit #this\n\n'
append env:.SmartMenu '\ntext 0 0 0 0 "©2002 by thenightshade@freenet.de" 40 nobox\n\n'
lvuse #this 1
lvgo first
while $$lv.line > ""
extract %item file item
extract item clean item
extract %menu clean mymenu
extract %name clean myname
if $myname = ""
myname = $item
item = ""
key = ""
endif
append env:.SmartMenu '\nxmenu "$mymenu" "$myname" "$item" "$key"\n'
extract %prog clean myprog
if $myprog != ""
ifexists file ~$myprog
append env:.SmartMenu 'run "$myprog"\n'
else
if $myprog H= G4C
append env:.SmartMenu 'run "gui $myprog"\n'
else
ifexists file $myprog\.info
append env:.SmartMenu 'run "smartmenu:wbrun $myprog"\n'
else
append env:.SmartMenu 'run "$myprog"\n'
endif
endif
endif
endif
lvgo next
endwhile
copy env:.SmartMenu smartmenu:SmartMenu
copy t:prog-list.db smartmenu:
delete env:.SmartMenu
lvuse #this 1
lvgo first
update #this 1 0
update #this 2 $%item
flash
ifexists window SmartMenu
guiclose SmartMenu
guirename SmartMenu StartMenu2
guiquit StartMenu2
endif
guiload smartmenu:SmartMenu
guiwindow #this resume
newfile editmenu
winbig -1 -1 300 122 "Menü editieren"
wintype 11000010
usetopaz
varpath "SmartMenuPrefs"
xonopen mode
guiwindow SmartMenuPrefs wait
redraw #this
docase $mode
case = new
setgad #this 1/7 on
setgad #this 1 on
update #this 1 ""
update #this 3 ""
update #this 4 ""
update #this 6 ""
oldname = ""
olditem = ""
oldprog = ""
break
case = edit
lvuse SmartMenuPrefs 1
extract %menu clean menu
extract %name clean name
extract %item clean item
extract %prog clean prog
if $name != BARLABEL
oldname = $name
else
oldname = ""
endif
if $item != BARLABEL
olditem = $item
else
olditem = ""
endif
if $prog != ""
oldprog = $prog
else
oldprog = ""
endif
update #this 1 $prog
update #this 3 $menu
update #this 4 $name
update #this 6 $item
if $name = BARLABEL
update #this 1 ""
setgad #this 1/2 off
update #this 6 ""
setgad #this 6/7 off
else
setgad #this 6/7 on
endif
if $item = BARLABEL
update #this 1 ""
setgad #this 1/2 off
if $name = BARLABEL
update #this 4 ""
setgad #this 4/5 off
else
setgad #this 4/5 on
endif
else
setgad #this 4/5 on
endif
if $name != BARLABEL
and $item != BARLABEL
setgad #this 1/2 on
endif
break
endcase
xonclose
guiwindow SmartMenuPrefs resume
box -1 -1 0 0 out button
box 10 92 280 2 in ridge
attr resize 0220
XTEXTIN 90 10 170 18 "Proggy:" "prog" "" 256
attr resize 0120
gadid 1
if $prog != ""
oldprog = $prog
endif
XBUTTON 264 11 16 16 "<"
attr resize 2100
gadid 2
reqprog = ""
reqfile -1 -1 400 300 "Wähle ein Programm:" load reqprog sys:
if $reqprog != ""
extract reqprog clean prog
extract reqprog file myitem
lvuse SmartMenuPrefs 1
update #this 1 $prog
update #this 3 Start
if $%name = ""
update #this 4 ""
else
extract name clean myname
update #this 4 $myname
endif
update #this 6 $myitem
endif
xtextin 90 30 190 18 "Titel:" "menu" "" 13
attr resize 0120
gadid 3
xtextin 90 50 190 18 "Unter:" "name" "" 13
attr resize 0120
gadid 4
if $name != BARLABEL
or $name != barlabel
or $name != Barlabel
or $name != BarLabel
oldname = $name
else
flash
update #this 4 $oldname
endif
xtextin 90 70 170 18 "Punkt:" "item" "" 13
attr resize 0120
gadid 6
if $item != BARLABEL
or $name != barlabel
or $name != Barlabel
or $name != BarLabel
olditem = $item
else
flash
update #this 6 $olditem
endif
XBUTTON 264 71 16 16 "B"
gadid 7
attr resize 2100
if $barlabel2 != 1
update #this 6 BARLABEL
setgad #this 1/2 off
update #this 1 ""
setgad #this 6 off
setgad #this 5 off
update #this 4 ""
barlabel2 = 1
else
update #this 6 $olditem
setgad #this 1/2 on
update #this 1 $oldprog
setgad #this 6 on
setgad #this 5 on
update #this 4 $oldname
barlabel2 = 0
endif
xbutton -1 100 50 17 "Okay"
attr resize 2200
guiwindow #this wait
if $menu = ""
flash
ezreq "Keinen Menü-Titel angegeben" "Upps" ""
goto skip
stop
endif
if $item = BARLABEL
gosub #this add2list
goto skip
stop
endif
if $item != BARLABEL
and $prog = ""
flash
ezreq "Kein Programm festgelegt" "Mist" ""
goto skip
stop
endif
if $item != ""
gosub #this add2list
else
flash
ezreq "Keinen Menü-Punkt definiert" "Au Backe" ""
endif
mark skip
guiwindow #this resume
xroutine add2list
lvuse SmartMenuPrefs 1
if $mode = new
if $$lv.line < $($$lv.total - 1)
lvinsert $($$lv.line + 1) ""
else
lvadd ""
endif
endif
%menu = $menu
%name = $name
%item = $item
%prog = $prog
if $mode = new
update SmartMenuPrefs 1 $$lv.line
endif
update SmartMenuPrefs 2 $item
lvmove 0
guiclose #this
newfile smenupos
WINBIG 0 600 155 11 "Fensterposition"
WINTYPE 11000000
WINFONT xhelvetica.font 9 000
varpath "SmartMenuPrefs"
xonclose
guiwindow SmartMenuPrefs resume
if $savepos = 1
*smleft = $left
*smtop = $top
endif
xonopen
guiwindow SmartMenuPrefs wait
savepos = 0
update #this 1 "X: $left Y: $top"
xbutton 0 0 20 0 R
guiclose #this
info gui SmartMenu
left = $$win.left
top = $$win.top
changearg #this 0 0 $left
changearg #this 0 1 $top
guiopen smenupos
savepos = 1
xbutton 20 0 30 0 Pos
top = $$win.top
left = $$win.left
update #this 1 "X: $left Y: $top"
savepos = 1
text 50 0 85 0 "" 40 box
gadid 1
xbutton 135 0 20 0 X
savepos = 0
guiclose #this